package zut.wework.entity.meeting;

import com.tencentcloudapi.wemeet.models.MeetingSetting;
import com.tencentcloudapi.wemeet.models.User;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.Collections;
import java.util.List;

/**
 * @Classname: CreateModel
 * @Description: 创建会议预填参数模板
 * @Date: 2022/5/9
 * @Created: by ifaxcaeles
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class CreatMeetingModel {
    /**
     * 必填
     */
    String userId;
    Integer instanceId;
    String subject;
    Integer type;
    String startTime;
    String endTime;
    /**
     * 非必填
     */
    List<User> invitees;
    List<User> hosts;
    MeetingSetting setting;

    public CreatMeetingModel(String userId, String subject) {
        User user = new User();
        user.setUserId(userId);
        this.userId = userId;
        this.subject = subject;
        this.instanceId = 1;
        this.startTime = String.valueOf(Instant.now().toEpochMilli() / 1000 + 60);
        this.endTime = String.valueOf(Instant.now().plus(30, ChronoUnit.MINUTES).toEpochMilli() / 1000 + 60);
        this.type = 0;
        this.hosts = Collections.singletonList(user);
    }
}
